package com.wangzeqi.changliaoba.singleton;

import android.graphics.Bitmap;

import com.android.volley.toolbox.ImageLoader;

/**
 * Created by dllo on 16/3/8.
 */
public class DoubleCache implements ImageLoader.ImageCache{

    private MyMemoryCache memoryCache;
//    private MyDiskCache diskCache;

    public DoubleCache() {
        memoryCache = new MyMemoryCache();
//        diskCache = new MyDiskCache();
    }
    @Override
    public Bitmap getBitmap(String url) {
        Bitmap bitmap = memoryCache.getBitmap(url);
//        if(null == bitmap){
//            bitmap = diskCache.getBitmap(url);
//        }
        return bitmap;
    }

    @Override
    public void putBitmap(String url, Bitmap bitmap) {

        memoryCache.putBitmap(url,bitmap);
//        diskCache.putBitmap(url,bitmap);
    }
}
